package com.zggk.iroad.guide;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;

import com.blankj.utilcode.util.StringUtils;

import com.zggk.iroad.DemoActivity;
import com.zggk.iroad.R;
import com.zggk.iroad.api.MyAppliCation;

import com.zggk.iroad.land.LandActivity;

import com.zggk.iroad.main.MainActivity;
import com.zggk.iroad.mvp.MVPBaseActivity;

import java.util.Locale;


/**
* @Description: (引导页)
* @author 张成昆
* @date 2020-8-28
*/

public class GuideActivity extends AppCompatActivity{
    private Handler handler;
    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.act_guide);
        initdate();
    }
    private void initdate() {
        handler = new Handler();
        if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
            finish();
        } else {
            if (StringUtils.isSpace(MyAppliCation.spUtils.getString("GydwId"))){
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        startActivity(new Intent(GuideActivity.this, LandActivity.class));
                        finish();
                    }
                }, 500);
            }else {
                handler.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        Intent intent = new Intent(GuideActivity.this, MainActivity.class);
                        intent.putExtra("isDown", true);
                        startActivity(intent);
                        finish();
                    }
                }, 500);
            }
        }
    }

}
